package cn.iocoder.yudao.module.hs.dal.mysql.shiporderdetail;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.hs.dal.dataobject.shiporderdetail.ShipOrderDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.hs.controller.admin.shiporderdetail.vo.*;

/**
 * 出库单明细 Mapper
 *
 * @author 航盛
 */
@Mapper
public interface ShipOrderDetailMapper extends BaseMapperX<ShipOrderDetailDO> {

    default PageResult<ShipOrderDetailDO> selectPage(ShipOrderDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShipOrderDetailDO>()
                .eqIfPresent(ShipOrderDetailDO::getShipOrderId, reqVO.getShipOrderId())
                .likeIfPresent(ShipOrderDetailDO::getMaterialName, reqVO.getMaterialName())
                .eqIfPresent(ShipOrderDetailDO::getMaterialCount, reqVO.getMaterialCount())
                .betweenIfPresent(ShipOrderDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShipOrderDetailDO::getId));
    }

}